<%@ page language="java" contentType="text/html; charset=UTF-8"
	pageEncoding="UTF-8"%>
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<%@include file="/common/common.jspf"%>
<link rel="stylesheet" type="text/css" href="${ctx}/js/date/jquery.datetimepicker.css"/>
<script type="text/javascript" src="${ctx}/js/system/product/edit.js"></script>
<style type="text/css">
.col-sm-3 {
	width: 20%;
	float: left;
}

.col-sm-9 {
	width: 80%;
	float: left;
}
</style>
</head>
<body>
	<div class="l_err" style="width: 100%; margin-top: 2px;"></div>
	<form id="form" name="form" class="form-horizontal" method="post"
		action="${ctx}/product/editEntity.shtml" enctype="multipart/form-data">
		<input type="hidden" class="form-control checkacc" value="${product.id}"
			name="productFormMap.id" id="id">
		<section class="panel panel-default">
				<div class="panel-body">
			<div class="form-group">
				<label class="col-sm-3 control-label">产品名称</label>
				<div class="col-sm-9">
					<input type="text" class="form-control checkacc"
						placeholder="请输入产品名称" name="productFormMap.name" id="name" value="${product.name}">
				</div>
			</div>
			<div class="line line-dashed line-lg pull-in"></div>
			<div class="form-group">
				<label class="col-sm-3 control-label">产品描述</label>
				<div class="col-sm-9">
					<input type="text" class="form-control checkacc"
						placeholder="请输入产品描述" name="productFormMap.bak" id="bak" value="${product.bak}">
				</div>
			</div>
			<div class="line line-dashed line-lg pull-in"></div>
			<div class="form-group">
				<label class="col-sm-3 control-label">产品图片</label>
				<input type="hidden" class="form-control checkacc"
						placeholder="请输入产品图片" name="productFormMap.imgfile" id="imgfile" value="${product.imgpath}">
				<div class="col-sm-9">
					<input type="file" name="file" class="form-control checkacc"
						placeholder="请输入产品图片" name="productFormMap.imgpath" id="imgpath" onchange="fileType(this)">
				</div>
			</div>
			<div class="line line-dashed line-lg pull-in"></div>
		</div>
			<footer class="panel-footer text-right bg-light lter">
			<button type="submit" class="btn btn-success btn-s-xs">提交</button>
		</footer> 
	</section>
	</form>
	<script type='text/javascript'>
		/* $(function(){
			$("from input[name='enable'][value='${role.enable}']").attr("checked","checked");
			alert("input[name='enable'][value='${role.enable}']");
		}); */
	</script>
</body>
<script type="text/javascript">
$('#startTime').datetimepicker({
	mask:'9999-19-39 29:59'
});
$('#endTime').datetimepicker({
	mask:'9999-19-39 29:59'
});
function fileType(obj){
	
	var fileType=obj.value.substr(obj.value.lastIndexOf(".")).toLowerCase();//获得文件后缀名
    if(fileType != '.gif' && fileType != '.png' && fileType != '.jpg' && fileType != '.jpeg'){
    alert("请上传正确图片格式");
    	$("#imgpath").val('');
    	document.getElementById("imgpath").files[0] = '请选择图片';
    }
}

</script>
</html>